package com.company.test16;

import javax.swing.*;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;

/**
 * Created by Administrator on 2016.8.2.
 */
public class Test1602 extends JFrame{
    public Test1602(){
        JPanel panel=new JPanel();
        panel.addComponentListener(new ComponentListener(){
            @Override
            public void componentHidden(ComponentEvent e) {
                System.out.println("hidden");
            }

            @Override
            public void componentMoved(ComponentEvent e) {
                System.out.println("move");
            }

            @Override
            public void componentResized(ComponentEvent e) {
                System.out.println("resized");
            }

            @Override
            public void componentShown(ComponentEvent e) {
                System.out.println("shown");
            }
        });
        this.add(panel);
    }

    public static void main(String[] args) {
        Test1602 frame = new Test1602();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationRelativeTo(null);
        frame.setTitle("Welcome to JAVA");
        frame.pack();
        frame.setVisible(true);
    }
}
